<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class m_kartupiutang extends CI_Model {
    function __construct() {
        parent::__construct();
    }

    function sum_piutang($date){
        return $this->db->query("SELECT a.ID_ANGGOTA, a.NAMA_ANGGOTA, iu.URAIAN_USAHA, pj.PIUTANG
                                from anggota a, info_usaha iu, pinjaman pj
                                where a.ID_ANGGOTA = pj.ID_ANGGOTA and iu.KODE_USAHA = pj.ID_INFO_USAHA
                                and pj.PIUTANG > 0
                                and pj.TGL_PINJAMAN like '$date%'
                                order by a.ID_ANGGOTA");
    }
}

?>
